//
//  AiRoleBean.swift
//  imprint
//
//  Created by 小柠檬🍋 on 2025/1/8.
//

import Foundation
import LeanCloud

class AiVoiceCrowdBean : ICloudTable, Codable,Identifiable {
    func getCloudTable() -> String {
        return "AiVoiceCrowd"
    }
    
    func doCustomExcluded() -> [String? : Any?] {
        return doExcluded(subject: self, excluded: [])
    }
    
    var objectId: String?
    var name:String? = nil
    var fileId:String? = nil
    var price: Double = 0.0//总价格
    var buyPrice: Double = 0.0//购买价格
    var voiceId: String? = nil
    var voiceHex:String? = nil
    var status : Int? = nil ///0为制作，1为已完成
    var count: Int? = nil

    func getProgress() -> TimeInterval{
        let total = 100.0
        var result = (price / total) * 100
        if (result > 100) {result = 100.0 }
        return result
    }
    
    func getProgressStr() -> String {
        String(format: "%.2f", getProgress())
    }
    
}
